<template>
	
		<div class="list list4 house">
			<yd-infinitescroll :callback="loadList" ref="infinitescrollDemo">
				<yd-list theme="4" slot="list" v-for="item, key in data" :key="key">
					<yd-list-item  @click.native="detailsrouter(item.id)">
						<img class="my-yd-list-img" slot="img" v-if="item.house_img.indexOf('?')==-1" :src="item.house_img+'?imageslim'">
						<img class="my-yd-list-img" slot="img" v-else :src="item.house_img">
						<span slot="title">{{item.title}}</span>
						<yd-list-other class="my-yd-list-other" slot="other">
							<div class="add-box">
								<div>
									<div class="h-introduce swiper-item">
										<span class="demo-list-price">{{item.room}}室{{item.hall}}厅{{item.toilet}}卫</span>
										<span>{{item.acreage}}m²</span>
									</div>
									<div v-if="item.station.length!=0" class="h-address">
										<!--<img class="map-icon" src="" />-->
										<yd-icon name="location" style="font-size: 0.24rem !important;"></yd-icon>
										<span>{{item.station}}</span>
									</div>
								</div>
								<div class="h-price">￥<span>{{item.price}}</span>/月</div>
							</div>
							<div class="house-icon">
								<span v-if="item.house_type==1">整租</span>
								<span v-if="item.house_type==2">合租</span>
								<span v-for="tagsitem,key in item.tags.split(',').slice(0,2) " :key="key" v-if="tagsitem!=''">{{tagsitem}}</span>
							</div>

						</yd-list-other>

					</yd-list-item>
				</yd-list>

				<!-- 数据全部加载完毕显示 -->
				<span slot="doneTip">暂无房源信息</span>
				<!-- 加载中提示，不指定，将显示默认加载中图标 -->
				<img slot="loadingTip" src="http://static.ydcss.com/uploads/ydui/loading/loading10.svg" />

			</yd-infinitescroll>
	</div>
</template>

<script>
	export default {
		name: 'LongView',
		data() {
			return {
				page: 1
			}
		},
		props: ["data"],
		methods: {
			//			详情路由跳转
			detailsrouter(houseId) {
				var that = this;
				that.$router.push({
					path: '/longDetails',
					query: {
						houseId: houseId
					}
				})
			},
			loadList() {
				/* 单次请求数据完毕 */

				this.$refs.infinitescrollDemo.$emit('ydui.infinitescroll.finishLoad');
				this.page++;
				this.$emit('getlongHouseList', this.page);

			}
		}
	}
</script>

<style>
	@import url("../assets/css/listfour.css");
</style>